home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_07 / storn / report < prev    next >
Text File  |  1994-05-03  |  3KB  |  55 lines

  1. line    1: { 0} ( 0) /* 0*/ " 0"  #include "stdtyp.h"  
  2. line    2: { 0} ( 0) /* 0*/ " 0"  #include <<stdio.h>>
  3. line    3: { 0} ( 0) /* 0*/ " 0"    
  4. line    4: { 0} ( 0) /* 0*/ " 0"  void  main(int argc, char *argv[])
  5. line    5: { 1} ( 0) /* 0*/ " 0"  {  
  6. line    6: { 1} ( 0) /* 0*/ " 0"         FILE  *fp1, *fp2;  
  7. line    7: { 1} ( 0) /* 0*/ " 0"         int  l;  
  8. line    8: { 2} ( 0) /* 0*/ " 0"         if ((fp1 = fopen(argv[1],"rw"))==0) {
  9. line    9: { 2} ( 0) /* 0*/ " 0"             printf("\n Cannot open output file 1 %s",argv[1]);
  10. line   10: { 2} ( 0) /* 0*/ " 0"             exit(0);  
  11. line   11: { 1} ( 0) /* 0*/ " 0"         }  
  12. line   12: { 1} ( 0) /* 0*/ " 0"         fp2 = fopen(argv[2],"rw");
  13. line   13: { 1} ( 0) /* 0*/ " 0"    
  14. line   14: { 1} ( 0) /* 0*/ " 0"         printf("1. Bubble sort\n");
  15. line   15: { 1} ( 0) /* 0*/ " 0"         printf("2. Quick sort \n");
  16. line   16: { 1} ( 0) /* 0*/ " 0"         printf("3. Merge sort\n");
  17. line   17: { 1} ( 0) /* 0*/ " 0"           
  18. line   18: { 1} ( 0) /* 0*/ " 0"         switch(l = scanf("%d",&l))
  19. line   19: { 2} ( 0) /* 0*/ " 0"         {  
  20. line   20: { 2} ( 0) /* 0*/ " 0"                 case 1 :  
  21. line   21: { 2} ( 0) /* 0*/ " 0"                      bub_sort(fp1,fp2);
  22. line   22: { 2} ( 0) /* 0*/ " 0"                        
  23. line   23: { 2} ( 0) /* 0*/ " 0"                 case 2:  
  24. line   24: { 2} ( 0) /* 0*/ " 0"                      qck_sort(fp1,fp2);
  25. line   25: { 2} ( 0) /* 0*/ " 0"                      break;  
  26. line   26: { 2} ( 0) /* 0*/ " 0"    
  27. line   27: { 2} ( 0) /* 0*/ " 0"                 case 3:  
  28. line   28: { 2} ( 0) /* 0*/ " 0"                     mg_sort(fp1,fp2);
  29. line   29: { 2} ( 0) /* 0*/ " 0"                     break;  
  30. line   30: { 1} ( 0) /* 0*/ " 0"         }  
  31. line   31: { 1} ( 0) /* 0*/ " 0"         fclose(fp1); fclose(fp2);
  32.  
  33. WARNING (line   31): this function has 0 comment lines only for 25 lines of code, please use at least 5 comment lines.
  34.  
  35. line   32: { 0} ( 0) /* 0*/ " 0"  }  
  36. line   33: { 0} ( 0) /* 0*/ " 0"    
  37. line   34: { 0} ( 0) /* 0*/ " 0"   
  38.  
  39. WARNING : 1 function(s) of this program is(are) not enough commented, see listing above for details.
  40.  
  41. WARNING (line    8) : == is forbidden, please use EQ instead.
  42. WARNING (line    4) : unsigned or (signed) char is forbidden, please use UCHAR or CHAR instead.
  43. WARNING (line    7) : int is forbidden, please use either BITFIELD if unsigned or SHORT or LONG if signed instead.
  44. WARNING (line    7) : l (easily confused with 1) is forbidden, please use any other variable name instead.
  45. WARNING (line    8) : the symbol { should stand in a separate line.
  46. WARNING (line   31) : the symbol ; should stand at the end of the line : there should be no more than one executable statement in a single line.
  47. WARNING (line    6) : the name of this pointer is wrong, it should end with _ptr.
  48. WARNING (line   23) : there is no break before this case. If the fall-through behaviour is deliberate, don't forget extensive comments !
  49. WARNING (line   18) : every switch selection must exhibit a default label.
  50. WARNING (line    8) : assignement in control flow statement should be avoided.
  51. WARNING (line   12) : the status information returned by this library function should be checked for validity before use.
  52. WARNING (line   18) : it is better to avoid using both value and address of an object in the same statement.
  53.  
  54.  
  55.